<%@ page language="java" import="java.util.*,org.cx.oa.entity.*" pageEncoding="UTF-8"%>
<%@ page import="org.cx.oa.util.*,javax.mail.*, javax.mail.internet.*"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'mailSubjects.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<script type="text/javascript">  
function a(o){

var i=document.getElementById("sub"+o);
alert(i);
i.submit();
i.click();
}

</script> 

</head>

<body bgcolor="#EEF2FB">
<%
		 MailClient client=(MailClient)session.getValue("mailuser");
		 if(client!=null){
		 %>
		 
	<table border="1" width="99%">
	
	<tr><td colspan="2" align="center"><b><%=client.getUser() %>收件箱</b></td></tr>
		<%
     Message message[] = conUtil.connecte(client.getUser(), client.getPass());
   mailUtil pmm=null;
  for(int i=0;i<message.length;i++){
 pmm = new mailUtil((MimeMessage)message[i]);
     %>
     <tr >
     <td width="70%" >
     <form action="message" method="post">
    <font size="4"><b> <%=pmm.getSubject() %></b> </font>   :   <font color="gray" size="2"><%=pmm.getFrom() %></font> 
     <input type="hidden" name="m.index" value="<%=i %>"></input>
     <input type="submit" value="详情"></input>
     </form>
     </td>
     <td align="right"><%=pmm.getSentDate() %></td>
     </tr>
     <%
     }
      %>
	</table>
	 <%
     }else{
      %>
      <h1>请先登陆邮箱</h1>
      <%
      }
       %>
</body>
</html>
